<?php


use yii\bootstrap\BootstrapAsset;
use common\models\shop\ShopOrderGoods;
use common\models\shop\ShopGoods;
use common\components\Upload;
use yii\helpers\Url;
BootstrapAsset::register($this);
$goods = Yii::$app->db->createCommand('select g.title,g.thumb,g.productprice,g.sales,g.weight,g.total,g.ishot,g.istime,g.isprebuy,g.isrecommand from '.ShopOrderGoods::tableName().' as og left join '.ShopGoods::tableName().' as g on og.goodsid=g.id where og.orderid=:orderid')
->bindValues([':orderid'=>$model->id])
->queryAll();


?>




<div class="row">
    <div class="col-md-12">
        <table class="table table-hover">
            <tr>
                <th>商品名称</a></th>
                <th>商品图片</th>
                <th>商品价格</th>
                <th>已售出</th>
                <th>重量</th>
                <th>库存</th>
            </tr>
            <?php foreach ($goods as $key => $row) {?>
            <tr>
                <td><?= $row['title'] ?></td>
                <td><img src="<?= Upload::checkGetUrl($row['thumb'],false,'thumb') ?>" alt="" width="100px;"></td>
                <td><?= $row['productprice'] ?></td>
                <td><?= $row['sales'] ?></td>
                <td><?= $row['weight'] ?></td>
                <td><?= $row['total'] ?></td>
            </tr>
            <?php } ?>
        </table>
    </div>
</div>